package com.readFile;

import java.io.*;
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class readFileCommend {
    public static void main(String[] args) throws IOException {

        System.out.println("请输入文件绝对路径：");
        Scanner scanner = new Scanner(System.in);
        String fileName = scanner.nextLine();

        BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(fileName),"utf-8"));
        String b = "";
        StringBuffer sb = new StringBuffer();
        while ((b = br.readLine())!=null){
            sb.append(b);
        }
        Pattern pattern = Pattern.compile("\\d+");

        Matcher matcher = pattern.matcher(sb);

        while (matcher.find()){
            System.out.println(matcher.group());
        }

    }
}
